package zzz.Text.text4;
public class Stringtext {
    public static void main(String[] args) {
        /* //获取说的话(replace方法)
        String talk = "你玩的不错,下次不要再玩了,TMD,SB";
        //定义一个敏感词组
        String[] arr = {"TMD","CNM","SB","MLGB"};
        //循环得到数组中的每一个敏感词组
        //String result = null;
        for (int i = 0; i < arr.length; i++) {
            talk = talk.replace(arr[i],"***");
        }
        System.out.println(talk);*/







        /*//定义一个字符记录身份证号码
        String id = "313282202204166543";
        //获取出生年月日
        String year = id.substring(6,10);
        String month = id.substring(10,12);
        String day = id.substring(12,14);
        System.out.println("人物信息为：");
        System.out.println("出生年月日："+year+"年"+month+"月"+day+"日");
        //获取性别
        char gender = id.charAt(16);
        //利用ASCII码表进行转换
        //‘0’--->进行转换
        int num = gender - 48;
        if(num % 2 == 0){
            System.out.println("性别为：女");
        }else {
            System.out.println("性别为：男");
        }*/












        /*//获取一个手机号码
        String phoneNumber = "1312423423421";
        //截取手机号码前面三位
        String start = phoneNumber.substring(0,3);
        //截取手机号码后面四位
        String end = phoneNumber.substring(7);
        //拼接
        String result = start + "****" + end;
        //打印
        System.out.println(result);*/
    }
}
